﻿package fab 
{
	import fab.geom.Segment;
	import flash.display.DisplayObject;
	import flash.geom.Point;
	
	/**
	 * ...
	 * @author fab
	 */
	public class Utils 
	{
		static public function PointLocalTransformation( p:Point, from:DisplayObject, to:DisplayObject ):Point
		{
			return to.globalToLocal( from.localToGlobal( p ) );
		}	
		static public function SegmentLocalTransformation( s:Segment, from:DisplayObject, to:DisplayObject ):Segment
		{
			return new Segment( PointLocalTransformation( s.debut, from, to ), PointLocalTransformation( s.fin, from, to ) );
		}		
	}
}